import './publicPath'
import { createApp } from 'vue'
import {Modal, Table, Menu, Input, Form, Tabs, Checkbox, Radio, Card, Descriptions} from 'ant-design-vue'
import store from './store'
import 'dayjs/locale/zh-cn'
import {permission} from '@/directives/permission'
import {AButton} from '@/components/button'
// import 'ant-design-vue/components/style.js';
import 'ant-design-vue/lib/style.js'
import 'ant-design-vue/dist/antd.css'
import "@/styles/theme.less"
import App from './App.vue'
import router from './router/'
// 路由守卫
import '@/router/router-guards'
import hasPermission from '@/utils/hasPermission'

const app = createApp(App)
app.directive('permission', permission)
app.use(hasPermission)
// app.config.globalProperties.$message = message
// 常用的ant-design-vue组件
app.component(Table.name, Table)
app.component(Input.name, Input)
app.component(Input.Search.name, Input.Search)
app.component(Input.TextArea.name, Input.TextArea)
app.component(AButton.name, AButton)
// app.component(Form.name, Form)
// app.component(Form.Item.name, Form.Item)
app.use(Form)
app.use(Modal)
app.use(Menu)
app.use(Checkbox)
app.use(Radio)
app.use(Tabs)
app.use(Card)
app.use(Descriptions)

app.use(router)
app.use(store)

router.isReady()
    .then(
        () => app.mount('#app')
    )

// app.config.devtools = true
